//
//  WelcomeViewController.swift
//  JIMWeiBo
//
//  Created by 陈恒均 on 2018/2/11.
//  Copyright © 2018年 陈恒均. All rights reserved.
//

import UIKit
import SDWebImage

class WelcomeViewController: UIViewController {

    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var iconBottomCons: NSLayoutConstraint!
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        let profileURLString = UserAccountViewModel.shareInstance.account?.avatar_large
        
        let url = URL(string: profileURLString ?? "")
        
        iconView.sd_setImage(with: url, placeholderImage: UIImage(named: "avatar_default_big"), options: [], completed: nil)
        
        
        iconBottomCons.constant = UIScreen.main.bounds.height - 250
        
        UIView.animate(withDuration: 1.5, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 5.0, options: [], animations: {
            self.view.layoutIfNeeded()
        }) { (_) in
            UIApplication.shared.keyWindow?.rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
        }
   
    }

   
}
